package com.suning.config;

import com.jfinal.config.Constants;
import com.jfinal.config.Handlers;
import com.jfinal.config.Interceptors;
import com.jfinal.config.JFinalConfig;
import com.jfinal.config.Plugins;
import com.jfinal.config.Routes;
import com.suning.controller.DemoController;

public class DemoConfig extends JFinalConfig {

	@Override
	public void configConstant(Constants me) {
		loadPropertyFile("init_info.txt");
		me.setDevMode(getPropertyToBoolean("DevMode"));
	}

	@Override
	public void configRoute(Routes me) {
		me.add("/", DemoController.class, "/WEB-INF/freemarker/");
	}

	@Override
	public void configPlugin(Plugins me) {

		/*C3p0Plugin c3p0Plugin = new C3p0Plugin(getProperty("jdbcUrl"), getProperty("username"),
				getProperty("password"));
		me.add(c3p0Plugin);
		ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);
		me.add(arp);
		arp.addMapping("t_person", "p_id", Person.class);*/
	}

	@Override
	public void configInterceptor(Interceptors me) {
		// TODO Auto-generated method stub

	}

	@Override
	public void configHandler(Handlers me) {
		// TODO Auto-generated method stub

	}

	@Override
	public void afterJFinalStart() {
		// TODO Auto-generated method stub
		super.afterJFinalStart();
		System.out.println("the jfinal is started!!");
	}

	@Override
	public void beforeJFinalStop() {
		// TODO Auto-generated method stub
		super.beforeJFinalStop();
	}
}
